/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main.testers;

import datatypes.Antenna;

import java.io.File;
import java.util.List;
import modules.pathloss.CoverageAdapter;
import tools.gis.antennaReader.AntennaSite;
import tools.gis.antennaReader.AntennaSiteReader;
import tools.gis.shapewriter.Write2Shapefile;
import tools.settings.SettingsAdapter;
import tools.settings.SettingsMissingException;

/**
 * Deze klasse neemt als input een array van Antennas   :   Antenna[]
 * 
 * Dan wordt op basis hiervan een shape-file bestand gemaakt. 
 * 1 shapefile bestand is op basis van de locatie van de antenna's
 * 1 shapefile bestand is op basis van de range de de antenna's
 *
 * @author Pieter Backaert
 */
public class GisShapefileTester {

    public static void main(String[] args) throws SettingsMissingException {


        CoverageAdapter ca = CoverageAdapter.getInstance();
        SettingsAdapter sa = SettingsAdapter.getInstance();

        try {

            sa.setDefaultFolder(new File("C:\\Eclipse Env\\CWN\\src"));

            sa.addSettings(new File(sa.getDefault_folder(), "gsm.xml"));

            AntennaSiteReader areader = new AntennaSiteReader();
            List<AntennaSite> list = areader.getAntennaSiteList(new File("C:\\Bipt antennes Brussels hoofdstedelijk gewest v2.shp"));
            Antenna[] antennas = areader.filterSiteListGUI(list);
            
            for (int i = 0; i < antennas.length; i++) {
                Antenna a = antennas[i];
            //     double radius = ca.getRangeRadius(a);
            //System.out.println("Antenna " + i + "  " + a.toString() + "  has radius " + radius);
            }

            Write2Shapefile wa2sf = new Write2Shapefile(ca);
            wa2sf.writeAntennas2shapefile(antennas, "SiteLocationsBasexx");

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
